<!DOCTYPE html>

<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">


<h:head>



	<style type="text/css">
.ui-layout,.ui-layout-doc,.ui-layout-unit,.ui-layout-wrap,.ui-layout-bd,.ui-layout-hd
	{
	border: none;
}

.companyHeaderGrid tr,.companyHeaderGrid td {
	border: none;
}
</style>

</h:head>

<h:body>

	<ui:composition>

		<h:form id="new_alloggio_form">

			<p:growl id="alloggioGrowl" autoUpdate="true"
				for="create_alloggio_growl" />



			<p:panelGrid columns="3" id="alloggio-data-panel"
				style="min-width: 100%; margin: 0 auto"
				styleClass="companyHeaderGrid">



				<f:facet name="header">
					<p:outputLabel style="font-size: 15pt">Dati dell'alloggio da creare</p:outputLabel>
				</f:facet>

				<h:outputText value="Nome Alloggio: " />
				<p:inputText required="true" id="desc"
					requiredMessage="Inserisci un nome per l'alloggio da inserire"
					value="#{alloggioBean.newAlloggio.descrizione}" />
				<p:message display="text" for="desc" />


				<h:outputText value="Citta: " />
				<p:autoComplete id="city" value="#{alloggioBean.newAlloggio.citta}"
					label="Citta: " completeMethod="#{cittaBean.complete}" var="c"
					itemLabel="#{c.name}" minQueryLength="3" itemValue="#{c}"
					forceSelection="true" converter="cittaConverter" required="true"
					requiredMessage="Inserire una città per l'alloggio">
					<p:ajax event="itemSelect" update="city" />
				</p:autoComplete>
				<p:message display="text" for="city" />

				<f:facet name="footer">
					<p:commandButton value="Conferma"
						actionListener="#{alloggioBean.addAlloggio}"
						update="new_alloggio_form" style="display: inline;"/>
  				</f:facet>
			</p:panelGrid>

		</h:form>


	</ui:composition>

</h:body>
</html>